#include<stdio.h>

void move(char x,char y);
void hanoi(int n,char A,char B,char C);

int main()
{
	int n;
	scanf("%d",&n);
	hanoi(n,'A','B','C');
}

void hanoi(int n,char A,char B,char C)
{
	if(n==1)	move(A,C);
	else
	{
		hanoi(n-1,A,C,B);
		move(A,C);
		hanoi(n-1,B,A,C);
	}
}

void move(char x ,char y)
{
	printf("%c------->%c\n",x,y);
}
